Skip to content

[Precogs Alert] Cross-Site Scripting (XSS) detected (CWE-79, Risk: Critical)#31

Open
sameer6pre wants to merge 1 commit intoPrecogs-fix-wio3jzc0from
Precogs-fix-vufe5d3o
Open

[Precogs Alert] Cross-Site Scripting (XSS) detected (CWE-79, Risk: Critical)#31
sameer6pre wants to merge 1 commit intoPrecogs-fix-wio3jzc0from
Precogs-fix-vufe5d3o

Conversation

@sameer6pre
Copy link
Owner

Vulnerability Details

  • File Path: orbit-app/src/components/CommentsSection.jsx
  • Vulnerability Type: Cross-Site Scripting (XSS)
  • Risk Level: Critical

Explanation:
The code renders user-supplied comments using React's dangerouslySetInnerHTML, directly injecting the cmt.comment property into the DOM as HTML. Since comments are submitted by users and fetched from the backend, an attacker can submit a comment containing malicious HTML or JavaScript (e.g., <script>alert(1)</script>). When this comment is rendered, the browser will execute the script, resulting in a stored XSS vulnerability. This allows attackers to steal session cookies, perform actions as other users, or deface the site. The root cause is the lack of sanitization or encoding of user input before rendering it as HTML.

Please review and address the issue accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant